package com.example.everying.framework.pay.service;

import com.example.everying.model.dto.pay.TransferToUserRequest;
import com.example.everying.model.dto.pay.TransferToUserResponse;
import com.wechat.pay.java.service.transferbatch.model.InitiateBatchTransferResponse;
import com.wechat.pay.java.service.transferbatch.model.TransferBatchEntity;
import com.wechat.pay.java.service.transferbatch.model.TransferDetailEntity;
import com.wechat.pay.java.service.transferbatch.model.TransferDetailInput;
import jakarta.servlet.http.HttpServletRequest;

import java.io.IOException;
import java.util.List;
import java.util.Map;

public interface WechatTransferService {

    //    WechatTransferServiceImpl client = new WechatTransferServiceImpl(weChatConfig.getMerchantId(),weChatConfig.merchantSerialNumber,weChatConfig.privateKeyPath,weChatConfig.publicKeyId,weChatConfig.publicKeyPath);
    //    public  WechatTransferServiceImpl(String mchid, String certificateSerialNo, String privateKeyFilePath, String wechatPayPublicKeyId, String wechatPayPublicKeyFilePath) {
    //        this.mchid = mchid;
    //        this.certificateSerialNo = certificateSerialNo;
    //        this.privateKey = WXPayUtility.loadPrivateKeyFromPath(privateKeyFilePath);
    //        this.wechatPayPublicKeyId = wechatPayPublicKeyId;
    //        this.wechatPayPublicKey = WXPayUtility.loadPublicKeyFromPath(wechatPayPublicKeyFilePath);
    //    }
    TransferToUserResponse transfer(TransferToUserRequest request);

    TransferToUserResponse queryTransferBillByOutNo(String outBillNo);

    InitiateBatchTransferResponse initiateTransfer(
            String outBatchNo,
            String batchRemark,
            List<TransferDetailInput> transferDetails);

    TransferBatchEntity queryBatchByOutBatchNo(
            String outBatchNo,
            boolean needQueryDetail,
            String detailStatus);

    TransferDetailEntity queryDetailByDetailId(String batchId, String detailId);

    TransferDetailEntity queryDetailByOutDetailNo(String outBatchNo, String outDetailNo);

    Map<String,Object> transferCallback(HttpServletRequest request) throws IOException;
}